package com.duoqin.guard;

import android.content.Context;
import android.provider.Settings;

import com.duoqin.common.utils.SystemPropertiesProxy;

public class Guard {
    public static final String DUOQIN_GUARD_PROP = "ro.duoqin.build.guard";

    public static final String DUOQIN_GUARD_ENABLED = "duoqin_guard_enabled";
    public static final String DUOQIN_GUARD_UNLOCKED = "duoqin_guard_unlocked";
    public static final String DUOQIN_GUARD_HEADER_IMAGE = "duoqin_guard_headerImg";
    public static final String DUOQIN_GUARD_SCREEN_LOCK_GREETING = "duoqin_guard_screen_lock_greetings";
    public static final String DUOQIN_GUARD_SCREEN_LOCK_PWD = "duoqin_guard_screen_lock_pwd";
    public static final String DUOQIN_GUARD_SCREEN_LOCK_TOGGLE = "duoqin_guard_screen_lock_toggle";
    public static final String DUOQIN_GUARD_SCREEN_LOCK_RULE_ENABLE = "duoqin_guard_screen_lock_rule_enable";
    public static final String DUOQIN_GUARD_LOCATION_ENABLED = "duoqin_guard_location_enable";
    public static final String DUOQIN_GUARD_LOCATION_MAP_ENABLED = "duoqin_guard_location_map_enable";
    public static final String DUOQIN_GUARD_LOCATION_MAP_MODE = "duoqin_guard_location_map_mode";
    public static final String DUOQIN_GUARD_APP_INSTALL_PERMISSION_REQUIRED =
            "duoqin_guard_app_install_permission_required";

    public static boolean isDuoqinGuardDevice(Context context) {
        return SystemPropertiesProxy.getBoolean(context, DUOQIN_GUARD_PROP, false);
    }

    public static boolean isDuoqinGuardEnable(Context context) {
        return isDuoqinGuardDevice(context) &&
                (1 == Settings.Global.getInt(context.getContentResolver(),
                        Guard.DUOQIN_GUARD_ENABLED, 0));
    }
}
